package com.alipay.demo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author: zhuzhiping
 * @description:
 * @date: 2021/1/6 10:49
 */

@Component
public class AlipayConfig {

    /**
     * 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
     */
    public static String appId;
    /**
     * 支付宝公钥,查看地址：https://openhome.alipay.
     */
    public static String alipayPublickey;
    /**
     * 支付宝网关
     */
    public static String alipayGatewayUrl;
    /**
     * 商户私钥，您的PKCS8格式RSA2私钥
     */
    public static String merchantPrivateKey;

    /**
     * 服务器异步通知页面路径  需http://格式的完整路径，不能加?id
     */
    public static String notifyUrl;
    /**
     * 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id
     */
    public static String returnUrl;
    /**
     * 签名方式
     */
    public static String signType;
    /**
     * 字符编码格式
     */
    public static String charset;
    /**
     * 字符编码格式
     */
    public static String format;
    /**
     * PC： FAST_INSTANT_TRADE_PAY
     */
    public static String productCodeForPc;
    /**
     * APP： QUICK_WAP_WAY
     */
    public static String productCodeForApp;

    public static String getAppId() {
        return appId;
    }

    @Value("${pay.ali.appId}")
    public void setAppId(String appId) {
        AlipayConfig.appId = appId;
    }

    public static String getAlipayPublickey() {
        return alipayPublickey;
    }

    @Value("${pay.ali.alipayPublickey}")
    public void setAlipayPublickey(String alipayPublickey) {
        AlipayConfig.alipayPublickey = alipayPublickey;
    }

    public static String getAlipayGatewayUrl() {
        return alipayGatewayUrl;
    }

    @Value("${pay.ali.alipayGatewayUrl}")
    public void setAlipayGatewayUrl(String alipayGatewayUrl) {
        AlipayConfig.alipayGatewayUrl = alipayGatewayUrl;
    }

    public static String getMerchantPrivateKey() {
        return merchantPrivateKey;
    }

    @Value("${pay.ali.merchantPrivateKey}")
    public void setMerchantPrivateKey(String merchantPrivateKey) {
        AlipayConfig.merchantPrivateKey = merchantPrivateKey;
    }

    public static String getNotifyUrl() {
        return notifyUrl;
    }

    @Value("${pay.ali.notifyUrl}")
    public void setNotifyUrl(String notifyUrl) {
        AlipayConfig.notifyUrl = notifyUrl;
    }

    public static String getReturnUrl() {
        return returnUrl;
    }

    @Value("${pay.ali.returnUrl}")
    public void setReturnUrl(String returnUrl) {
        AlipayConfig.returnUrl = returnUrl;
    }

    public static String getSignType() {
        return signType;
    }

    @Value("${pay.ali.signType}")
    public  void setSignType(String signType) {
        AlipayConfig.signType = signType;
    }

    public static String getCharset() {
        return charset;
    }

    @Value("${pay.ali.charset}")
    public  void setCharset(String charset) {
        AlipayConfig.charset = charset;
    }

    public static String getFormat() {
        return format;
    }

    @Value("${pay.ali.format}")
    public void setFormat(String format) {
        AlipayConfig.format = format;
    }

    public static String getProductCodeForPc() {
        return productCodeForPc;
    }

    @Value("${pay.ali.productCodeForPc}")
    public  void setProductCodeForPc(String productCodeForPc) {
        AlipayConfig.productCodeForPc = productCodeForPc;
    }

    public static String getProductCodeForApp() {
        return productCodeForApp;
    }

    @Value("${pay.ali.productCodeForApp}")
    public  void setProductCodeForApp(String productCodeForApp) {
        AlipayConfig.productCodeForApp = productCodeForApp;
    }
}
